package easy

func IsOneBitCharacter(bits []int) bool {
	index := 0
	for index < len(bits) {
		if index == len(bits)-1 {
			return true
		}
		if bits[index] == 1 {
			index += 2
		} else {
			index++
		}
	}
	return false
}
func IsOneBitCharacter1(bits []int) bool {
	i := 0
	for i < len(bits)-1 {
		i += bits[i] + 1
	}
	return i == len(bits)-1
}
